package me.sdevil507.supports.sequence;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.query.Procedure;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * 序列池存储过程调用
 *
 * @author sdevil507
 */
@Repository
public interface CommonSequenceCall extends JpaRepository<CommonSequence, String> {

    /**
     * 根据序列池中key值,获取当前value值
     *
     * @param seqName 序列池中key
     * @return key对应value值
     */
    @Procedure(name = "next_seq_no")
    Long nextSeqNo(@Param("seq_name") String seqName);
}
